let id = getQueryString('id');
let $info = $('.info');
let init = {
  url: 'http://chst.vip:1234/api/getdiscountproduct?productid=' + id,
  success: e,
}

function e(res) {
  let element = res.result;
  console.log(element[0]);
  let infoStr = '';
  let regExp = /^<[^<]+\s+src="([^''""]*)"/;
  let imgUrl = element[0].productImg.match(regExp);
  console.log(imgUrl);
  infoStr = `
  <li class="item">
  <div class="infoR">
    <div class="title">
      <h4>${element[0].productName}</h4>
    </div>
    <div class="other">
      <span>${element[0].productFrom} | ${element[0].productTime}</span>
      <i>${element[0].productTips}</i>
    </div>
    <div class="container">
      <p>
        <img src="${imgUrl[1]}" alt="">
        ${element[0].productInfo}   
      </p>
    </div>
    <div class="bigimg">

      <img src="${imgUrl[1]}" alt="">
    </div>

  </div>
</li>`

  console.log(infoStr);
  $info.append(infoStr)
}
ajaxAPI(init)